//
//  CurrentUserInfo.m
//  Leisure
//
//  Created by xalo on 16/4/22.
//  Copyright © 2016年 xalo. All rights reserved.
//

#import "CurrentUserInfo.h"

@implementation CurrentUserInfo
+(CurrentUserInfo *)sharedCurrentUserInfo{
    static CurrentUserInfo *currentUserInfo=nil;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        currentUserInfo=[[CurrentUserInfo alloc]init];
    });
     return currentUserInfo;
}
//属性的setter方法
-(void)setUserName:(NSString *)userName{
    if (userName) {
        [[NSUserDefaults standardUserDefaults]setObject:userName forKey:@"name"];
    }
}

-(void)setPassword:(NSString *)password{
    if (password) {
        [[NSUserDefaults standardUserDefaults]setObject:password forKey:@"password"];
    }
}

//-(void)setUid:(NSString *)uid{
//    if (uid) {
//        [[NSUserDefaults standardUserDefaults]setObject:uid forKey:@"uid"];
//    }
//}




-(void)setIsLogin:(BOOL)isLogin{
   
    [[NSUserDefaults standardUserDefaults]setBool:isLogin forKey:@"isLogin"];
    
}

//getter方法
-(NSString *)userName{
    return [[NSUserDefaults standardUserDefaults]objectForKey:@"name"];
}
-(NSString *)password{
    return [[NSUserDefaults standardUserDefaults]objectForKey:@"password"];
}
-(BOOL)isLogin{
    return [[NSUserDefaults standardUserDefaults]boolForKey:@"isLogin"];
}

//-(NSString *)uid{
//    return [[NSUserDefaults standardUserDefaults]objectForKey:@"uid"];
//}



@end
